#include <mainwindow.hpp>

#include <QApplication>
#include <QSplashScreen>

#ifdef Q_OS_LINUX
#include <unistd.h>
#include <dlfcn.h>
#endif

int
main(int argc, char **argv)
{
    QApplication  app(argc, argv);
    QSplashScreen splash;
    QPixmap       pixmap;

    pixmap = QPixmap(":/splash");

    splash.setPixmap(pixmap.scaled(400, 400, Qt::KeepAspectRatio));
    splash.show();

    MainWindow window;

    while (QApplication::hasPendingEvents())
        QApplication::processEvents();
#ifdef Q_OS_LINUX
    sleep(1);
#else
#endif

    splash.close();

    window.initialize();
    window.show();
    app.exec();

    return 0;
}
